home *** CD-ROM | disk | FTP | other *** search
Java Source | 2000-09-28 | 1.0 KB | 52 lines | [TEXT/CWIE] |
-
- package jens.radio;
-
- import java.io.*;
-
-
- /** A BufferStream is a special collection of Buffers.
-
- Buffers are added to the end by calling addBuffer, and
- Buffers are read sequentially by BufferStreamIterators. <p>
-
- The addBuffer method will block if it's too far ahead of the
- nearest reader -- this prevents the number of buffers from exploding,
- since Buffers are typically much faster to create then to send. <p>
-
- New Iterators start out from the <i>latest</i> available Buffer, since
- a new listener should start out as close to real-time as possible.
- This means that Buffers that have already been read by the farthest-behind
- Iterator are no longer reachable through the BufferStream, and are
- released. */
-
- public class BufferStream {
-
- public BufferStream( ) {
- fBuffers = new Vector();
- }
-
-
- public void addBuffer( Buffer buf ) {
-
- }
-
-
- public BufferIterator iterate( ) {
- }
-
- }
-
-
- public class BufferStreamIterator {
-
- BufferStreamIterator( BufferStream s ) {
- fBufferStream = s;
- }
-
-
- public Buffer next( ) {
- •
- }
-
- }
-